package kr.hkit.powerjava.chapter12.poly;

interface Comparable{
	//이 객체가 다른 객체보다 크면1, 같으면 0, 작으면 -1을 반환
	int compareTo(Object other);
}

class Person implements Comparable{
	private String name;
	private static int height;
	
	
	public Person(String name, int height){
		this.name = name;
		this.height = height;
	}
	
	public int compareTo(Object obj){
		Person other = (Person) obj;
		if(Person.height < other.height) return -1;
		else if(Person.height > other.height)	 return 1;
		else return 0;
	}
	
/*	public getMaximum(Person[] array){
		
	}
	*/

	
}


public class PersonTest {
	public static void main(String[] args) {
/*		Person arrPerson[] = new Person[3];
		arrPerson = new Person[3];
		arrPerson[0] = new Person("홍길동", 190);
		arrPerson[1] = new Person("임꺽정", 180);
		arrPerson[2] = new Person("박철수", 170);*/	
			
	
		Person p1 = new Person("홍길동", 190);	
		Person p2 = new Person("임꺽정", 180);
		
		
/*		for(int i =0; i<arrPerson.length;i++){
			System.out.println(arrPerson[i]);
		}*/
	}
}
